/*
 * @Author: Simon 1958058172@qq.com
 * @Date: 2025-08-11 11:45:55
 * @LastEditors: Simon 1958058172@qq.com
 * @LastEditTime: 2025-08-11 14:42:35
 * @FilePath: \java.1212\csdn\jihe\li02\Test.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package csdn.jihe.li02;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class Test {
    public static void main(String[] args) {
        Collection<Student> collection=new ArrayList<>();
        Student student=new Student("李霄01",18,"男");
        //add
        collection.add(student);
        Collection<Student> collection2=new ArrayList<>();
        Student student2=new Student("李霄02",18,"女");
        collection2.add(student2);
        System.out.println(collection.size());
        //addAll
        collection.addAll(collection2);

        System.out.println(collection);
        System.out.println(collection2);

        //contains
        boolean flag1=collection.contains("李霄");
        boolean flag2=collection.containsAll(collection2);

        System.out.println(flag1);
        System.out.println(flag2);

        //toArray;
        Object[] obj1= collection.toArray();
        Object[] obj2= collection2.toArray();
        


        //remove
        collection.remove("18");
        boolean flag3= collection2.remove("18");

        System.out.println(collection);
        System.out.println(flag3);
        System.out.println(collection2);

    }
}
